{% extends 'base.html' %}
{% load static %}
{% block 'title' %}确认订单{% endblock%}
{% block 'header-title' %}确认订单{% endblock%}
{% block 'content' %}
    <div class="container">
<section>
    <h1>收货地址
        {% include 'widget-search.html'%}</h1>
        <div class="table-responsive">
            <table class="table  table-hover">
                <thead >
                    <tr>
                        <th>#</th>
                        <th>地区</th>
                        <th>详细地址</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    {% for item in paginator %}
                    <tr>
                        <td>{{forloop.counter0|add:paginator.start_index}}</td>
                        <td>{{item.location}}</td>
                        <td>{{item.detail}}</td>
                        <td>
                            <a class="btn-link" href="{% url 'address_modify' item.pk %}">修改</a>
                            <a class="btn-link" href="{% url 'address_delete' item.pk %}">删除</a>
                        </td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
            
            {% include 'widget-paginator.html' %}
        </div>
</section>
<hr>
<section>
    <h1>添加地址</h1>
    {% include 'message.html' %}
    <form method="post" class="ml-3">
        {% csrf_token %}
        <div class="form-group row">
            <div class="input-group mb-2">
                <div class="input-group-prepend">
                    <div class="input-group-text">地址</div>
                </div>
                
                {% include 'address-widget-location.html' %}
                <input name="detail" class="form-control" type="text" required>
                <button class="btn btn-success" type="submit">添加</button>
            </div>
        </div>
    </form>
</section>
    </div>
{% endblock %}